import { createRouter, createWebHashHistory } from "vue-router"

import Home from "../views/Home.vue"
import About from "../views/About.vue"
import AboutChildA from "../views/AboutChildA.vue"
import AboutChildB from "../views/AboutChildB.vue"

const routes = [
    { path: "/", component: Home },
    {
        path: '/about',
        component: About,
        children: [
            { path: "", component: AboutChildA }, // 默认展示的子路由
            { path: "aboutchildb", component: AboutChildB }
        ]
    },
    { path: '/about/:name/my/:myid', component: About, props: {name:true} },
    // 注册可以传参的路由,这个上满有两个参数name和myid,加上:就表示他是一个动态的参数
]


export default createRouter({
    // 使用hash模式
    history: createWebHashHistory(),
    routes
})

